package com.yuju.enums;
/**
 * 
 * 类名：alipayReturnCodeEnum  <br />
 *
 * 功能：支付相关
 *
 * @author : sunyl <br />
 * @Date : 2018年1月8日 上午10:27:20  <br />
 * @version : 1.1 <br />
 */
public enum AlipayReturnCodeEnum {
	PAY_SUCCESS("yuju-alipay-1000", "支付成功"),
	PAY_FAILURE("yuju-alipay-1001", "支付失败"),
	PAY_UNKNOWN("yuju-alipay-1002", "系统异常，订单状态未知!!!"),
	REFUND_SUCCESS("yuju-alipay-1003", "订单退款成功"),
	REFUND_FAILURE("yuju-alipay-1004", "订单退款失败"),
	REFUND_UNKNOWN("yuju-alipay-1005", "系统异常，订单退款状态未知!!!"),
	DEFAULT("yuju-alipay-1006", "不支持的交易状态，交易返回异常!!!");
	
	private String code;
	private String desc;
	
	AlipayReturnCodeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	public static String getDescByCode(String code) {
		for (AlipayReturnCodeEnum enume : AlipayReturnCodeEnum.values()) {
			if (enume.getCode().equals(code)) {
				return enume.getDesc();
			}
		}
		
		return "未知枚举类型";
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}